package es.us.lsi.daw.dao.repository;

import java.util.Date;
import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import es.us.lsi.daw.model.Tweet;

@Transactional
@Repository
public interface ITweetRepository extends  MongoRepository<Tweet, String> {
	
//	@Query("{ state : 'ACTIVE' }")
//	  Page<Job> findOneActiveOldest(Pageable pageable);
	
	@Query("{publish_date: { $gte: ?0, $lt : ?1  }}")
	public List<Tweet> findBetweenDatePageable(Date startDate, Date endDate, Pageable pageable);
	
}
